<template>
	<div>
		<el-dialog :title="title" :visible.sync="dialogTableVisible">
			<el-form :model="form" label-width="100px">
				<el-form-item label="角色名称">
					<el-input v-model="form.name" autocomplete="off"></el-input>
				</el-form-item>
				<el-form-item label="描述">
					<el-input type="textarea" v-model="form.name" autocomplete="off"></el-input>
				</el-form-item>
				<el-form-item label="权限选择">
					 <el-checkbox-group v-model="form.checkList">
					    <el-checkbox label="超级管理员"></el-checkbox>
					    <el-checkbox label="审方药师"></el-checkbox>
					    <el-checkbox label="临床药师"></el-checkbox>
						<el-checkbox label="测试"></el-checkbox>
					  </el-checkbox-group>
				</el-form-item>
			</el-form>
		    <div slot="footer" class="dialog-footer">
		      <el-button @click="dialogTableVisible = false">取 消</el-button>
		      <el-button type="primary" @click="dialogTableVisible = false">确 定</el-button>
		    </div>
		</el-dialog>
	</div>
</template>

<script>
	export default {
		props:{
			openType:{
				type:String
			}
		},
		watch:{
			openType (val) {
				if(val == "add"){
					this.title = "添加角色";
				}else if(val == "edit"){
					this.title = "编辑角色";
				}else if(val == "look"){
					this.title = "查看角色";
				}
			}
		},
		data () {
			return {
				title:"",
				form: {
				  name: '',
				  checkList: []
				},
				dialogTableVisible:false
			}
		},
		methods:{
			show () {
				this.dialogTableVisible = true;
			}
		}
	}
</script>

<style>
</style>
